<?php  $all_session = $this->session->all_userdata(); ?>
<!DOCTYPE html>
<!-- saved from url=(0056)http://startbootstrap.com/templates/simple-sidebar.html# -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>Panel</title>
<?php $this->load->view('panel_head');?>

</head>

<body onload="startTime()">
<?php $this->load->view('panel_header');?>
<div style="height:46px;"></div>
<div id="wrapper"> 
  
  <!-- Sidebar -->
  <div id="sidebar-wrapper">
    <?php $this->load->view('panel_sidebar');?>
  </div>
  
  <!-- Page content -->
  <div id="page-content-wrapper">
    <div class="content-header">
      <h1><span class="glyphicon glyphicon-film"></span>&nbsp;Information </h1>
    </div>
    <!-- Keep all page content within the page-content inset div! -->
    <div class="page-content inset">
      <div class="row">
        <div class="col-md-12">
          <h4><strong><?php echo @$profile[0]['vdo_name']; ?></strong></h4>
        </div>
      </div>
      <!-- <div class="row"> -->
      
      <div class="row" >
        <div class="col-md-5" align="center" style="margin-bottom:2em;"> 
          
          <!--
        <img src="<?php echo base_url(); ?>vod_thumb/<?php echo $profile[0]['vdo_rawfile'];?>/<?php echo $thumb[0]['thumb_name'];?>" width="100%"> 
        -->
          <div class="embed-responsive embed-responsive-16by9">
    	<iframe class="embed-responsive-item" src="http://<?php echo $profile[0]['server_ip'];?>/stream-project/?cs=<?php echo $profile[0]['vdo_rawfile'];?>" scrolling="no" frameborder="no" marginheight="0"  marginwidth="0" width="100%" height="459em"></iframe>
        </div>

          
        </div>
        <?php echo form_open('pvdo/update_profile/'.$profile[0]['vdo_id']) ; ?>
        <div class="col-md-7" style="margin-bottom:2em;">
          <table width="100%">
            <tr >
              <td width="23%">Owner</td>
              <td width="2%">:</td>
              <td width="75%"><?php echo @$profile[0]['mem_name']; ?></td>
            </tr>
            <tr>
              <td>Uploaded time</td>
              <td>:</td>
              <td><?php echo @$profile[0]['vdo_uploadtime']; ?></td>
            </tr>
            <tr>
              <td>Raw file</td>
              <td>:</td>
              <td><?php echo @$profile[0]['vdo_rawfile']; ?></td>
            </tr>
            <tr>
              <td>Duration</td>
              <td>:</td>
              <td><?php echo @$profile[0]['vdo_timeduration']; ?></td>
            </tr>
            <tr>
              <td>File size</td>
              <td>:</td>
              <td><?php 
			  		$bytes = @$profile[0]['vdo_size']; 
				    $CI =& get_instance();
					$CI->load->library('calculate_byte');
					$file_size = $CI->calculate_byte->index($bytes);
					
					printf ('%.2f ', $file_size[0]);
                    echo $file_size[1];
			  		
			  ?></td>
            </tr>
            <tr>
              <td>Views</td>
              <td>:</td>
              <td><?php echo $profile[0]['vdo_view'];?></td>
            </tr>
            <tr>
              <td>Like</td>
              <td>:</td>
              <td><?php echo $this->player_model->like($profile[0]['vdo_id']); ?></td>
            </tr>
            <tr>
              <td>Dislikes</td>
              <td>:</td>
              <td><?php echo $this->player_model->dislike($profile[0]['vdo_id']); ?></td>
            </tr>
            <tr>
              <td>Video URL</td>
              <td>:</td>
              <td><a href="<?php echo base_url();?>index.php/player/cs/<?php echo $profile[0]['vdo_id'];?>"><?php echo base_url();?>index.php/player/cs/<?php echo $profile[0]['vdo_id'];?></a></td>
            </tr>
            <tr>
              <td colspan="3"><input type="checkbox" name="check_delete"style="width:1.7em; height:1.7em;" value="<?php echo $profile[0]['vdo_id'];?>"  /> 
                delete vdo
                </td>
            </tr>
          </table>
        </div>
        <!-- <div class="col-md-6"> --> 
      </div>
      <!-- <div class="row"> -->
             
      <div class="row">
        <div class="col-md-2" align="center">
             
            <div class="btn-group" data-toggle="buttons">
              <label class="btn btn-default <?php if($thumb[0]['thumb_choose'] == 1) { echo 'active'; } ?>">
             <input type="radio" name="options" autocomplete="off" value="0"><img src="<?php echo base_url(); ?>vod_thumb/<?php echo @$profile[0]['vdo_rawfile'];?>/<?php echo @$thumb[0]['thumb_name'];?>" width="100%"></input>
              </label>
              <label class="btn btn-default <?php if($thumb[1]['thumb_choose'] == 1) { echo 'active'; } ?>">
                <input type="radio" name="options" autocomplete="off" value="1"><img src="<?php echo base_url(); ?>vod_thumb/<?php echo @$profile[0]['vdo_rawfile'];?>/<?php echo @$thumb[1]['thumb_name'];?>" width="100%"></input>
              </label>
              <label class="btn btn-default <?php if($thumb[2]['thumb_choose'] == 1) { echo 'active'; } ?>">
                <input type="radio" name="options" autocomplete="off" value="2"><img src="<?php echo base_url(); ?>vod_thumb/<?php echo @$profile[0]['vdo_rawfile'];?>/<?php echo @$thumb[2]['thumb_name'];?>" width="100%"></input>
              </label>
              <?php if(count($thumb) > 3) { ?>
              <label class="btn btn-default <?php if($thumb[2]['thumb_choose'] == 1) { echo 'active'; } ?>">
                <input type="radio" name="options" autocomplete="off" value="3"><img src="<?php echo base_url(); ?>vod_thumb/<?php echo @$profile[0]['vdo_rawfile'];?>/<?php echo @$thumb[3]['thumb_name'];?>" width="100%"></input>
              </label>
              <?php } ?>
              
            </div>
            <div style="margin-top:1em;">
            <button class="btn btn-primary " data-toggle="modal" data-target="#upload" type="button"><span class="glyphicon glyphicon-edit"></span>&nbsp;customised</button>
            </div>
            <!--
          <div>
            <button type="button" class="btn btn-default" data-dismiss="modal">Customised</button>
          </div>
          -->
        </div>
 
        <div class="col-md-5">
          <div style="padding-bottom:0.2em;"> <strong>Title</strong> </div>
          <div style="padding-bottom:1em;">
            <input type="text" class="form-control" value="<?php echo @$profile[0]['vdo_name']; ?>" name="vdo_name" required />
           
          </div>
          <div style="padding-bottom:0.2em;"> <strong>Description</strong> </div>
          <div>
            <textarea class="form-control" rows="3" style="height:11.3em;" name="vdo_des"><?php echo str_replace("<br>\n", "\n", $profile[0]['vdo_des']); ?></textarea>
            
       
          </div>
        </div>
        <div class="col-md-5">
          <div style="padding-bottom:0.2em;"> <strong>Share</strong> </div>
          <div style="padding-bottom:1em;">     
          <?php if(@$profile[0]['vdo_status'] == '' && $all_session['login'][0]['mem_type'] != 2) { ?>     
          <fieldset disabled>
          <?php } ?>
            <select class="form-control" name="vdo_status">
              <option value="<?php echo $profile[0]['vdo_status'];?>">--
              <?php
					if(@$profile[0]['vdo_status'] == '0')
					{
						echo 'Public';
					}else if(@$profile[0]['vdo_status'] == '1'){
						echo 'Private';
					}else {
						echo 'Pending';
					}
			  ?>
              --</option>
              <option value="0">Public</option>
              <option value="1">Private</option>
            </select>
             <?php if(@$profile[0]['vdo_status'] == '' && $all_session['login'][0]['mem_type'] != 2) { ?>   
		 </fieldset>
         <?php } ?>
            <script>
			$(function () {
			  $('#example').popover('hide')
			})
			</script>
          </div>
          
          
          <div style="padding-bottom:0.2em;"> <strong>Category</strong> </div>
          <div style="padding-bottom:1em;">
            <select class="form-control" name="category_id">
              <option value="<?php echo $profile[0]['category_id'];?>">-- <?php echo $profile[0]['category_name'];?> --</option>
              
              <?php foreach ($category as $category)
			  {
					echo '<option value="'.$category['category_id'].'">'.$category['category_name'].'</option>';
			  }
			  ?>
              
            </select>
          </div>
          
          
          <div style="padding-bottom:0.2em;"> <strong>Tags</strong> </div>
          <div>
            <input type="text" data-role="tagsinput" style="display: none;" name="vdo_tag" value="<?php echo $profile[0]['vdo_tag']; ?>">
            </input>
          </div>
          
          <div style="padding-bottom:0.2em;"> <strong>Event</strong> </div>
          <div style="padding-bottom:1em;">
            
           <?php 
		   		$this->db->where_not_in('event_name','');
		   		$this->db->select('event_name');
				$this->db->group_by('event_name');
				$query = $this->db->get('vdo');
				$event_list = $query->result_array();				
		   ?> 
          <input list="event" name="event_name" class="form-control" autocomplete="off" value="<?php echo $profile[0]['event_name']; ?>">
          <datalist id="event">
          	<?php foreach($event_list as $event_list) { ?>
            	<option value="<?php echo $event_list['event_name']; ?>">
            <?php } ?>
          </datalist>
          </input>

          </div>

		<div style="padding-bottom:0.2em;"> <strong>Event : Start up</strong> </div>
          <div style="padding-bottom:1em;">
         
			<input type="text" id="start" data-format="YYYY-MM-DD" data-template="D MMM YYYY" name="event_start" value="<?php echo $profile[0]['event_start'];?>"/>
            
            
            <script id="js-date">
				$(function(){
					$('#start').combodate();    
				});
			</script>
          </div>     
          
          <div style="padding-bottom:0.2em;"> <strong>Event : Ending</strong> </div>
          <div style="padding-bottom:1em;">
         
			<input type="text" id="end" data-format="YYYY-MM-DD" data-template="D MMM YYYY" name="event_end" value="<?php echo $profile[0]['event_end'];?>"/>
            
            
            <script id="js-date">
				$(function(){
					$('#end').combodate();    
				});
			</script>

          </div>        
          
     
          
          
          
          
          <div align="right" style="padding-top:4em;"> <a href="<?php echo base_url();?>index.php/pvdo">
            <button type="button" class="btn btn-default" data-dismiss="modal">Cancle</button>
            </a>
            <button type="submit" class="btn btn-warning">Save</button>
          </div>
          <?php echo form_close(); ?> 
          
          
          
          </div>
          
          
      </div>
      <!-- <div class="row"> --> 
      
    </div>
    <!-- <div class="page-content inset"> --> 
    
  </div>
  <!--  <div id="page-content-wrapper"> --> 
  
</div>
<!-- <div id="wrapper"> --> 

<!-- upload -->
<div class="modal fade" id="upload" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel">Customised thumbnail</h4>
      </div>
      <div class="modal-body" style="padding-bottom:1em;">
       <?php echo form_open_multipart('pvdo/custom_thumbnail');?>
        <table width="100%">
          <tr>
            <td  height="35em" style="vertical-align:top;">
            <input type="file" id="file_1" name="userfile" size="20" required />
            </td>
          </tr>
          <tr>
            <td align="right">           
              <button class="btn btn-primary " type="submit">Upload</button>
              <button type="button" class="btn btn-default" data-dismiss="modal">Cancle</button>
              <input type="hidden" value="<?php echo $profile[0]['vdo_id'];?>" name="id"/>
              <input type="hidden" value="<?php echo $profile[0]['vdo_rawfile'];?>" name="rawfile" />
             </td>
          <tr>
        </table>
        <?php echo form_close();?>
      </div>
    </div>
  </div>
</div>
<!-- upload --> 

<!-- Custom JavaScript for the Menu Toggle --> 
<script>
    $("#menu-toggle").click(function(e) {
        e.preventDefault();
        $("#wrapper").toggleClass("active");
    });
</script> 

<!-- checkbox --> 
<script>
$('#select-all').click(function(event) {   
    if(this.checked) {
        // Iterate each checkbox
        $(':checkbox').each(function() {
            this.checked = true;                        
        });
    }else{
		$(':checkbox').each(function() {
			this.checked = false;
		});
	}
});
</script>
</body>
</html>
